package com.ruoyi.web.controller.doulai;

import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.system.service.IMarqueeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * FileName: StatisticController
 * Author:   miuqin
 * Date:     2019/1/3 17:55
 * Description:
 */
@Controller
@RequestMapping("/doulai/marquee")
public class MarqueeController extends BaseController {

    @Autowired
    private IMarqueeService marqueeService;
    @GetMapping()
    @RequiresPermissions("doulai:marquee:view")
    public String marquee(){
        return "/pages/message/message";
    }

    @RequestMapping(value = "/getMarquee")
    @ResponseBody
    @RequiresPermissions("doulai:marquee:view")
    public String getMarquee()
    {
        return marqueeService.getMarquee();
    }

    @RequestMapping(value = "/setMarquee")
    @ResponseBody
    @RequiresPermissions("doulai:marquee:setMarquee")
    public AjaxResult getMarquee(HttpServletRequest request, String message)
    {
        int i = marqueeService.setMarquee(message);
        return toAjax(i);
    }



}